<?php
global $openId;
$openId=getCurrentUserOID();//id
$bm=new CUI数据中心(Page::m卖家中心_账目,$openId);
$注册 = $bm->生成有效链接('register',$_GET['state']);
$店铺id = $_SESSION['vo用户数据']['所属店铺id'];
$用户id = $_SESSION['vo用户数据']['id'];
//$用户id = 94;
$区域 = pdo()->selectAll('SELECT * FROM 区域');
$sql = "SELECT a.头像 as 头像,a.密码 as 密码 ,a.认证 as 认证 ,b.*,c.区域 as 区域 from 用户 as a left join 医师详情 as b  on a.id = b.用户id left join 区域 as c on b.区域id = c.id  where a.id = $用户id";
$个人信息 = pdo()->selectOne($sql);

$上传工作证 = $bm->生成有效链接('Seller18RenZheng',$_GET['state']);
$推广详情 = $bm->生成有效链接('Seller11Qrcodelist',$_GET['state']);
if($个人信息['密码']==""){
    header("Location:".$注册);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"/>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><?php if($个人信息['name']){echo '爱贝儿医';}else{echo '资料完善';}?></title>
    <link rel="stylesheet" href="../style/common.css?<?=版本?>">
    <script src="../resource/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
        //关闭窗口
        function closeWind(){
            if(typeof(WeixinJSBridge)=='undefined')
                window.close();
            else
                WeixinJSBridge.invoke('closeWindow',{},function(res){
                    return true;
                });
        }
    </script>
    <script type="text/javascript">
        //下面用于图片上传预览功能
        function setImagePreview(avalue) {
            var docObj=document.getElementById("doc");
            var imgObjPreview=document.getElementById("preview");
            if(docObj.files && docObj.files[0])
            {
//火狐下，直接设img属性
                imgObjPreview.style.display = 'block';
                imgObjPreview.style.width = '100%';
                imgObjPreview.style.height = '100%';
//imgObjPreview.src = docObj.files[0].getAsDataURL();

//火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
                imgObjPreview.src = window.URL.createObjectURL(docObj.files[0]);
            }
            else
            {
//IE下，使用滤镜
                docObj.select();
                var imgSrc = document.selection.createRange().text;
                var localImagId = document.getElementById("localImag");
//必须设置初始大小
                localImagId.style.width = "100%";
                localImagId.style.height = "100%";
//图片异常的捕捉，防止用户修改后缀来伪造图片
                try{
                    localImagId.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                    localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
                }
                catch(e)
                {
                    alert("您上传的图片格式不正确，请重新选择!");
                    return false;
                }
                imgObjPreview.style.display = 'none';
                document.selection.empty();
            }
            return true;
        }


    </script>
</head>

<body>
<form class="form-horizontal" name="form1"  action="../commit.php" method="post" enctype="multipart/form-data" onsubmit="return fun()">
    <input type="hidden" name="businessFlag" value="资料完善<?php if ($个人信息['id']){echo '修改';}?>">
    <input type="hidden" name="医师详情id" value="<?=$个人信息['id']?>">
    <input type="hidden" name="上传工作证" value="<?=$上传工作证?>">
    <input type="hidden" name="用户id" value="<?=$用户id?>">
    <input type="hidden" name="头像" value="<?=$个人信息['头像']?>">
    <input type="hidden" name="状态" value="<?=$个人信息['状态']?>">
    <input type="hidden" name="认证" value="<?=$个人信息['认证']?>">
    <!--头部固定-->
    <div class="header">
        <div class="header"><a href="#" class="return">返回</a></div>
    </div>
    <div class="renzheng-cont">
        <div class="renzheng-img">
            <div id="localImag" class="img"><img id="preview" src="<?php if(empty($个人信息['头像'])){echo 'style/renxiang.png' ;} else{ echo $个人信息['头像']; }  ?>"  style="display: block;"><input type="file" name="pic" id="doc" style="width:100%;position:relative;top:-60px;opacity:0;height:100%;" onchange="javascript:setImagePreview();"></div>
            <p class="word">请上传个人真实照片头像</p>
        </div>

        <div class="AMu-form">
            <div class="AMu-form-list">
                <div class="AMu-form-list-title"><div>姓名</div></div>
                <div class="AMu-form-list-cont"><input type='text' class=" input" name="name" id="name" value="<?=$个人信息['name']?>"  required="required" onFocus="this.style.color='#000'" onBlur="this.style.color='#ccc'"></div>
                <div class="clear"></div>
            </div>

            <div class="AMu-form-list">
                <div class="AMu-form-list-title"><div>所在医院</div></div>
                <div class="AMu-form-list-cont"><input type='text' class=" input" name="医院" value="<?=$个人信息['医院']?> " required="required" onFocus="this.style.color='#000'" onBlur="this.style.color='#ccc'" ></div>
                <div class="clear"></div>
            </div>
            <div class="AMu-form-list">
                <div class="AMu-form-list-title"><div>职务</div></div>
                <div class="AMu-form-list-cont"><input type='text' class=" input" name="职务"   value="<?=$个人信息['职务']?> "onBlur="this.style.color='#ccc'" onFocus="this.style.color='#000'"></div>
                <div class="clear"></div>
            </div>
            <div class="AMu-form-list">
                <div class="AMu-form-list-title"><div>专业领域</div></div>
                <div class="AMu-form-list-cont"><input type='text' class=" input" name="专业领域"  value="<?=$个人信息['专业领域']?> "   onBlur="this.style.color='#ccc'" onFocus="this.style.color='#000'"></div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="geren-cont">
        <textarea name="简介" id=""  value=" " placeholder="填写个人简历 获得更多关注"  style="text-align:left;" onFocus="this.style.color='#000';this.value=' '" onBlur="this.style.color='#ccc'">
            <?=$个人信息['简介']?>
        </textarea>
        </div>
        <div class="next"><input type="submit" value="下一步"/></div>
    </div>

</form>
<div style="width:100%;height:30px;"></div>
<div style="height:30px;width:100%;background:#db3655;color:#fff;font-size:80%;line-height:30px;text-align:center;position:fixed;bottom:0px;">操作过程中如有疑问，请致电客服热线：400-825-8989</div></body>
</body>
</html>
